package com.ref.entity;

/**
 * @author wzm
 * @create 2023-02-14 9:40
 */
public class Student {
    public int id;
    private String name;
    private int age;

    public Student() {
    }

    public Student(String name) {
        this.name = name;
    }

    public Student(int age) {
        this.age = age;
    }

    //私有
    private Student(String name, int age) {
        this.name = name;
        this.age = age;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }

    @Override
    public String toString() {
        return "Student{" +
                "name='" + name + '\'' +
                ", age=" + age +
                '}';
    }

    public void sleep(){
        System.out.println("学生在睡觉");
    }

    public String eat(String name){
        System.out.println("学生在吃"+name);
        return name;

    }

    private void sayHello(String username){
        System.out.println(username+"你好！");
    }
}
